package KASystem;

import java.io.Serializable;
import java.util.ArrayList;

/*
 * HETTA ER EIN KLASSI HJÁ KRISTJAN
 * @author Kristjan
 */

class ConferenceHandler implements Serializable {
    private ArrayList<Conference> conferences;
    private ArrayList<Daytrip> dayTrips;
    private ArrayList<Hotel> hotels;
    
    public ConferenceHandler(){
        conferences = new ArrayList<>();
        dayTrips = new ArrayList<>();
        hotels = new ArrayList<>();
    }
    
    public void addConference(Conference c){
        if(!conferences.contains(c)){
            conferences.add(c);
        }
    }
    
    public ArrayList<Conference> getConferences(){
        return conferences;
    }
    
    public void deleteConference(Conference c){
        conferences.remove(c);
    }
    
    public void deleteConference(int i){
        conferences.remove(i);
    }
    
    public void addDaytrip(Daytrip trip)
    {
        dayTrips.add(trip);
    }
    
    public ArrayList<Daytrip> getDaytrips()
    {
        ArrayList<Daytrip> temp = new ArrayList<>();
        for(Daytrip d : dayTrips)
        {
            temp.add(d);
        }
        
        return temp;
    }
    
    public void addHotel(Hotel hotel)
    {
        hotels.add(hotel);
    }
    
    public ArrayList<Hotel> getHotels()
    {
        ArrayList<Hotel> temp = new ArrayList<>();
        for(Hotel h : hotels)
        {
            temp.add(h);
        }
        return temp;
    }
}